<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
	<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
	<%@ page isELIgnored="false" %>
<!DOCTYPE html>
<%
	String path = request.getContextPath();
%>
<html>
<head>

<link rel="stylesheet" type="text/css"
	href="<%=path%>/script/easyUI-1.4/themes/bootstrap/easyui.css">
<link rel="stylesheet" type="text/css"
	href="<%=path%>/script/easyUI-1.4/themes/icon.css">
<script type="text/javascript"
	src="<%=path%>/script/easyUI-1.4/jquery-3.2.1.min.js"></script>
<script type="text/javascript"
	src="<%=path%>/script/easyUI-1.4/jquery.easyui.min.js"></script>
<script type="text/javascript"
	src="<%=path%>/script/easyUI-1.4/locale/easyui-lang-zh_CN.js"></script>
</head>
<script type="text/javascript">
function showindex(){
	location.href="<%=path%>/userAction/login";
}

$(function(){
	
	$("#guanzhuBtn").bind("click",function(){
		
	    $.ajax({
            //几个参数需要注意一下
                type: "POST",//方法类型
                dataType: "json",//预期服务器返回的数据类型
                url: "<%=path%>/userAction/guanzhu?userId=${user.id}",
                success: function (result) {
                	if(result.errMsg != null && result.errMsg != ""){
                    	$.messager.alert('提示',result.errMsg);                     	
                    }else{
                    	$.messager.alert('提示',result.msg);                     	
                    }
                    
                },
                error : function() {
                    alert("系统异常！");
                }
            });
		
	})
	
	
	//发送添加好友请求
	$("#addBtn").bind("click",function(){
		
	    $.ajax({
            //几个参数需要注意一下
                type: "POST",//方法类型
                dataType: "json",//预期服务器返回的数据类型
                url: "<%=path%>/userAction/friendRequest?userId=${user.id}",
                success: function (result) {
                	$.messager.alert('提示',result.msg); 
                },
                error : function() {
                    alert("系统异常！");
                }
            });
		
	});
	
})
</script>



<body class="easyui-layout" >   
    <div data-options="region:'north'" style="height:120px;">
    	<div style="margin-left: 100px;margin-top: 20px">
    		<img alt="hello" src="<%=path%>/img/per_lib_logo.jpg" width="50px" height="50px" align="top">
    		<font size="6px" onclick="showindex();">个人图书馆</font>
    		<hr style="width:2px;height:30px;margin-top: -40px;margin-left:240px"></hr>
    	</div>
    	<div style="margin-top: -60px;margin-left: 500px;">
    		<div>
    			<img alt="" src="<%=path%>/img/touxiang.gif">
    		</div>
    		<div>
    			<h2 style="margin-top: -70px;margin-left: 120px;">${user.username}</h2>
    			<font style="margin-left: 120px;">${userInfo.jianjie}</font>
    		</div>
    		<hr style="width:2px;height:30px;margin-top: -40px;margin-left:205px"></hr>
    		<div style="margin-left: 120px;">
    			<h2 style="margin-top: -53px;margin-left: 120px;">${guanzhuMount}</h2>
    			<font style="margin-left: 120px;">关注</font>
    		</div>
    		<hr style="width:2px;height:30px;margin-top: -40px;margin-left:295px"></hr>
    		<div style="margin-left: 120px;">
    			<h2 style="margin-top: -54px;margin-left: 220px;">${fansMount}</h2>
    			<font style="margin-left: 220px;">粉丝</font>
    		</div>
    		<div style="margin-left: 120px;">
    			<a id="guanzhuBtn" href="#" style="margin-top: -64px;margin-left: 420px;" class="easyui-linkbutton" data-options="iconCls:'icon-add'">关注</a> 
    			<a id="addBtn" href="#" style="margin-top: -93px;margin-left: 520px;" class="easyui-linkbutton" data-options="iconCls:'icon-add'">加好友</a> 
    		</div>
    	</div>
    	
    </div>   
     
   
    </div>   
    <div data-options="region:'center'" >
    		<div id="tabs" class="easyui-tabs" fit="true" border="false" data-options="tabWidth:100,tabHeight:30">
				<div title="他的馆藏" style="padding-top:20px;padding-left:20px;padding-right:20px; overflow: hidden; color: red;">
					<iframe scrolling="auto" application="yes" frameborder="0" style="width:100%;height:100%;" src="<%=path%>/guancangAction/guancangView?userId=${user.id}"></iframe>
				</div>
		</div>
    </div>   
    
</body>  

</html>